package cn.netswap.jeegorilla.web;


import cn.netswap.jeegorilla.framework.scheduler.quartz.GorillaSchedulerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Controller
@RequestMapping("/aaa")
public class TestController {

    Logger log = LoggerFactory.getLogger(TestController.class);

    @Autowired
    private GorillaSchedulerFactory gorillaSchedulerFactory;

    @RequestMapping("delCron/{id}")
    public void delCron(@PathVariable Long id) throws Exception {
        gorillaSchedulerFactory.pauseJob(id);
    }

    @RequestMapping("addCron/{id}")
    public void addCron(@PathVariable Long id) throws Exception {
        gorillaSchedulerFactory.resumeJob(id);
    }

    @RequestMapping("testIntercepter")
    public String testIntercepter(){
        log.info("在执行testIntercepter");
        return "testIntercepter";
    }

    @RequestMapping("elementadminpack")
    public String elementindexController(){
        System.out.println("elementindexController");
        return "/elementadminpack/index";
    }
}
